package com.gxpt.app.adapter;

import android.content.Context;
import android.widget.TextView;

import com.gxpt.app.AppUtils;
import com.gxpt.app.R;
import com.gxpt.app.base.ListBaseAdapter;
import com.gxpt.app.base.SuperViewHolder;
import com.gxpt.app.bean.fnewlist_bean;
import com.gxpt.app.bean.mypub_bean;
import com.utils.ScreenUtils;
import com.utils.logger.Logger;

/**
 * Created by Lzx on 2016/12/30.
 */

public class mypub_Adapter extends ListBaseAdapter<mypub_bean.mypub> {

    //列表图片
    int pic_view_width = 0;
    int pic_view_hight = 0;
    Context context;
    public mypub_Adapter(Context context) {
        super(context);
        this.context = context;
        int Sviewwidth  = ScreenUtils.getScreenWidth(context);//
        pic_view_width  = (Sviewwidth- AppUtils.dip2px(context,10*2))/4;
        pic_view_hight  = pic_view_width;

//        Logger.i("屏幕 = " + Sviewwidth);
//        Logger.i("宽 = " + pic_view_width);
//        Logger.i("高 = " + pic_view_hight);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_center_myneedadd_list;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        mypub_bean.mypub item = mDataList.get(position);

        TextView txt_title = holder.getView(R.id.txt_title);
        txt_title.setText(item.title);

        TextView txt_create_time = holder.getView(R.id.txt_create_time);
        txt_create_time.setText(item.create_time);

        TextView txt_status = holder.getView(R.id.txt_status);
        txt_status.setText(AppUtils.getSTUTS(item.status));

        TextView txt_jiaoyimoshi = holder.getView(R.id.txt_jiaoyimoshi);
        txt_jiaoyimoshi.setText(AppUtils.getJYMS(item.bidding_model));

        TextView txt_yusuan = holder.getView(R.id.txt_yusuan);
        txt_yusuan.setText(item.project_amount);

        TextView txt_jingbiaorenshu = holder.getView(R.id.txt_jingbiaorenshu);
        txt_jingbiaorenshu.setText(item.bid_count);

        TextView txt_jingbiaostuts = holder.getView(R.id.txt_jingbiaostuts);
//        txt_jingbiaostuts.setText(item.bid_status);
        txt_jingbiaostuts.setText(AppUtils.getJBSTUTS(item.bid_status));
    }
}
